package com.hmdp.controller;


import com.hmdp.dto.Result;
import com.hmdp.service.IFollowService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 虎哥
 * @since 2021-12-22
 */
@RestController
@RequestMapping("/follow")
public class FollowController {
    @Resource
    IFollowService iFollowService;
    @GetMapping("/or/not/{id}")
    public Result isFollow(@PathVariable("id")long id){
          return iFollowService.isFollow(id);
    }
    @PutMapping("/{uid}/{flag}")
    public Result follow(@PathVariable("uid")long uid,@PathVariable("flag")boolean flag){
          return iFollowService.follow(uid,flag);
    }
    @GetMapping("/common/{id}")
    public Result followCommons(@PathVariable("id")long uid){
           return iFollowService.followCommons(uid);
    }
}
